﻿@model LanLordz.Models.ViewNewsModel
@{
    ViewBag.Title = "News";
    var controller = this.ViewContext.Controller as LanLordzBaseController;
}
@section headers
{
  <link rel="alternate" type="application/atom+xml" href="?format=atom" title="@controller.Config.SiteName News (Atom 1.0)"/>
}
    @if (Model.Posts != null)
    {
    <div class="NewsIcon"><a href="?format=atom"><img src="@Url.Content("~/Content/FeedIcon.png")" /></a></div>
    }
    <h2>News</h2>
    @if (Model.Posts == null)
    {
    <div>The administrators have not configured the news page.</div>
    }
    else
    {
        foreach (var post in Model.Posts)
        {
    <div class="NewsPost">
     <div class="NewsPostTitle">@(string.IsNullOrEmpty(post.Title) ? "(no title)" : post.Title)</div>
     <div class="NewsPostDate">@controller.ConvertDateTime(post.CreateDate).ToShortDateString()</div>
     <div class="NewsPostText">@Html.BBCode(post.Text)</div>
     <div class="NewsPostAuthor">- @post.User.Username</div>
    </div>
        }
    }
